package com.hq.tomato.ms.config;

import com.hq.tomato.ms.aop.IdempotentMessageAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

/**
 *
 *
 * @Description: <br> 幂等自动装配 目前需要依赖redis
 * @Project: <br>
 * @CreateDate: Created in 2019-11-20 19:57 <br>
 * @Author: <a href="1026365768@qq.com">qiang.hu</a>
 */
@ConditionalOnClass(RedisTemplate.class)
public class TomatoIdempotentAutoConfiguration {

    /**
     * @Author huqiang
     * @Description //TODO 消息幂等切面 依赖于redis
     * @Date  2019-11-20
     * @Param
     * @return com.hq.tomato.ms.aop.IdempotentMessageAspect
     */
    @Bean
    @ConditionalOnClass(RedisTemplate.class)
    public IdempotentMessageAspect idempotentMessageAspect(){
        return new IdempotentMessageAspect();
    }
}
